// const http = 'http'

// const server = http.creatServer()

const mysql = require('mysql')
const {
    createConnection
} = require('net')


const connection = mysql.createConnection({
    host: 'localHost',
    user: 'root',
    password: 'a945271134',
    database: 'luminous'
})
connection.connect()

const sql = 'select * from message_copy'

connection.query(sql, function (error, result) {
    // console.log(error);
    // console.log(result)
    if (error) {
        console.log('输出有误')
        console.log(error)
    } else {
        result.forEach(element => {
            console.log(element.id, element.name, element.content)
        });
    }
})


// server.on('request',function(request,response){

// })